package com.xgggh.binding.viewbinder.myredpack;

import android.databinding.DataBindingUtil;
import android.support.annotation.NonNull;
import android.view.LayoutInflater;
import android.view.ViewGroup;

import com.xgggh.binding.data.redpack.RedPack;
import com.xgggh.binding.viewbinder.base.BaseItemViewBinder;
import com.xgggh.binding.viewbinder.base.ViewHolder;
import com.xgggh.redpack.R;
import com.xgggh.redpack.databinding.ContentMyRedPackReceiveBinding;

/**
 * Created by az on 2018/5/26.
 */

public class ReceiveViewBinder extends BaseItemViewBinder<RedPack> {
    @NonNull
    @Override
    protected ViewHolder onCreateViewHolder(@NonNull LayoutInflater inflater, @NonNull ViewGroup parent) {
       ContentMyRedPackReceiveBinding _binding= DataBindingUtil.inflate(inflater, R.layout.content_my_red_pack_receive,parent,false);
        return new ViewHolder(_binding.getRoot());
    }

    @Override
    protected void onBindViewHolder(@NonNull ViewHolder holder, @NonNull RedPack item) {
        ContentMyRedPackReceiveBinding _binding = DataBindingUtil.getBinding(holder.itemView);
        _binding.setRedPack(item);
    }

}
